/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entity;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.DiscriminatorValue;

@Entity
@DiscriminatorValue("Owner")
public class Owner extends Person{  //inheritance of PERSON
   
    @OneToMany(mappedBy="Owner")
    private List<Pet> pet= new ArrayList<>(); //one Owner hasMany pets
    
    public Owner(){
    super();
    }
    public List<Pet> getPet(){
        return pet;
    }
    public Owner(String name, String lastname, String SSN, Date bithdate, String birthplace, List<Pet> Pets) {
        super(name, lastname, SSN, bithdate, birthplace);
        this.pet= Pets;
    }
    
    public void setPet(List<Pet> pet) {
        this.pet = pet;
    }
}
